Conventionally, a known electronic key system performs radio communication between an electronic key, which a user of a vehicle carries, and the vehicle and performs the locking or unlocking of a vehicle door and the starting or stopping of the engine when verification of the electronic key is successful. In such electronic key systems, communication between the electronic key and the vehicle needs to be protected in order to ensure security. Thus, in the electronic key system, encrypted communication is performed between the electronic key and the vehicle (for example, refer to patent document 1). In the encrypted communication, contents of communication are encrypted to ensure high confidentiality.
As the above encrypted communication, the common key cryptosystem is employed. The common key cryptosystem uses the same encryption key for encryption and decryption. Thus, the electronic key and the vehicle need to have the same encryption key. The encryption key is registered to the electronic key and the vehicle when registering the electronic key to a controller of the vehicle. The controller authenticates the electronic key by verifying identification information that is transmitted through radio communication from the electronic key with identification information that is stored in the controller.